@theme-color: #a5cf4c;
@error-color: #ed4014;
@border-color: #dcdee2;


.vm-select {
  display: block;
  width: 100%;
  position: relative;
  height: 32px;
  &.disabled {
    opacity: 0.4;
    pointer-events: none;
  }

  &.vm-active {
    .vm-select-section {
      border: 1px solid @theme-color;
      box-shadow: 0 0 0 2px rgba(143, 195, 31, 0.2);
    }
  }
  &.vm-active.vm-select--error {
    .vm-select-section {
      border: 1px solid @error-color;
      box-shadow: 0 0 0 2px rgba(237, 64, 20, 0.2);
    }
  }
}
.vm-select--error .vm-select-section {
  border-color: @error-color;
}
.vm-select-section {
  display: flex;
  border: 1px solid @border-color;
  border-radius: 2px;
  box-sizing: border-box;
  font-size: 14px;
  padding: 5px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
  transition: all 0.2s linear;
  text-align: left;
  background: #fff;

  &:hover {
    border: 1px solid @theme-color;
  }

  &.--placeholder {
    color: #bdbaba;
  }
}
.vm-select--clear {
  display: none;
}
.vm-has-value:hover .vm-select--clear{
  display: block;
}
.vm-has-value:hover .vm-select--icon-arrow {
  display: none;
}
.vm-select--icon-arrow {
  color: #000;
  display: block;
  width: 20px;
  text-align: center;
  position: relative;
  transition: transform .2s linear;
  transform-origin: center center;

  &:after,
  &:before {
    position: absolute;
    content: '';
    width: 0;
    height: 0;
    top: 50%;
    left: 50%;
    margin-left: -4px;
    margin-top: -3px;
    border-top: 4px solid #333;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;

  }

  &:after {
    border-top: 4px solid #fff;
    margin-top: -4px;
  }
}

.vm-select.vm-active .vm-select--icon-arrow {
  transform: rotate(180deg);
}

.vm-select--label {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  flex: 1;
}

.vm-select--placeholder {
  color: #bdbaba;
}
.vm-select--search {
  position: relative;
  svg {
    position: absolute;
    left: 0;
    top: 5px;
  }
}
.vm-select--input {
  border-radius: 5px;
  margin: 0 0 5px;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 2px;
  appearance: none;
  width: 100%;
  height: 28px;
  padding: 5px;
  padding-left: 20px;
  font-size: 12px;
  box-sizing: border-box;

  &:focus {
    outline: none;
  }
}

.vm-select--actionbox {
  height: 30px;
  line-height: 28px;
  margin: 0 0 5px;
  display: flex;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 2px;

  .vm-actionbox {
    flex: 1;
    cursor: pointer;
    background: #fff;
    border-radius: 0;
    border: 1px solid transparent;
    user-select: none;
    touch-action: manipulation;
    text-transform: none;
    appearance: none;
    color: #494949;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-writing-mode: horizontal-tb !important;

    &:last-child {
      border-left: 1px solid #ddd;
    }

    &:focus {
      outline: 0;
      border: 1px solid @theme-color;
      box-shadow: 0 0 0 2px rgba(143, 195, 31, 0.2);
    }
  }
}

.vm-select-dropdown {
  position: absolute;
  padding: 10px 10px 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: absolute;
  font-size: 14px;
  text-align: left;
  line-height: 22px;
  background-color: #ffffff;
  border-radius: 0 0 2px 2px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  transform-origin: center top 0px;
}

ul.vm-dropdown--content {
  margin: 0 -10px;
  padding: 0;
  list-style: none;
  max-height: 224px;
  overflow: auto;

  li {
    line-height: 28px;
    padding: 0 20px 0 10px;
    position: relative;
    color: #494949;
    &:hover {
      background-color: #f8f8f8;
      cursor: pointer
    }

    &.multiple--selected:after {
      width: 10px;
      height: 5px;
      content: '';
      display: block;
      position: absolute;
      right: 10px;
      top: 50%;
      margin-top: -4px;
      border-left: 1px solid #333;
      border-bottom: 1px solid #333;
      z-index: 10;
      transform: rotate(-45deg);
    }

    &.single--selected {
      background-color: #f3f3f3;
    }

    &.disabled--selected {
      opacity: 0.4;
      background-color: #f9f9f9;
      cursor: not-allowed;
      pointer-events: none;
    }
  }
}

.vm-dropdown--element {
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  overflow: hidden;

  &.element--empty {
    text-align: center;
    color: #bdbaba
  }
}

// 动画
.vm-drop-enter-active,
.vm-drop-leave-active {
  animation-duration: .3s;
  animation-fill-mode: both;
  animation-play-state: paused
}

.vm-drop-appear,
.vm-drop-enter-active {
  animation-name: ivuTransitionDropIn;
  animation-play-state: running
}

.vm-drop-leave-active {
  animation-name: ivuTransitionDropOut;
  animation-play-state: running
}

.vm-drop-appear,
.vm-drop-enter-active {
  opacity: 0;
  animation-timing-function: ease-in-out
}

.vm-drop-leave-active {
  animation-timing-function: ease-in-out
}

@keyframes ivuTransitionDropIn {
  0% {
    opacity: 0;
    transform: scaleY(.8)
  }

  to {
    opacity: 1;
    transform: scaleY(1)
  }
}

@keyframes ivuTransitionDropOut {
  0% {
    opacity: 1;
    transform: scaleY(1)
  }

  to {
    opacity: 0;
    transform: scaleY(.8)
  }
}